package com.jobpass.controller;

import org.springframework.util.ResourceUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@RestController
@RequestMapping("/file")
public class FileController {

    @PostMapping("/upload")
    private String upload(@RequestParam("file")MultipartFile file) throws IOException {
        String path = ResourceUtils.getURL("").getPath()+"static/images";
        if (file.isEmpty()) {

            return "";
        }
        return "index";
    }
}
